

#ifndef _H_STRCTRL
#define _H_STRCTRL

#include "arrayctrl.h"
//#define SC_MAX_BUF 256
#define SC_MAX_BUF 1440

#define SC_SPACE " "
#define SC_LINEFEED "\r\n"
#define CRLF "\r\n"
#define SC_SEMICOLON ";"
#define SC_EQUAL "="
#define SC_MINUS "-"
#define SC_SLASH "/"
#define SC_DSLASH "//"
#define SC_OPTION  ":"
//Skip delimeter in srcStr
//
//Parameter:
//	srcStr		Source string
//	delim 		String which need to be skiped		
//Return:
//	Address of the new start in the source string
//
 char *skipstr(char * srcStr, char * delim);

//Dump sub string to string buffer
//
//Parameter:
//	stcStr		Source string
//	delim 		Delimeter for end of sub string
//	destBuf		Output buffer for dumped sub string
//Return:
//	Address in source strong after the first delimeter
//
 char *token(char * srcStr, char * delim, char * destBuf);

//Cut the spaces in front and end of the source string
//
//Parameter:
//	srcStr		Source string
//	desfBuf		Output buffer for cutted string
//Return:
//	Start address in source string 
//
 char *trim(char * srcStr, char * destBuf);

//Convert string to unsigned integer value
//
//Parameter:
//	buf 			Input string
//
//Return:
//	Converted unsigned integer value
//
 uint32 struint(char * buf);

//Split string into dynamic array list by delimeter
//
//Parameter:
//	srcStr		Source string
//	delim			Delimeter
//Return:
//	Handle of dynamic array which is used to store splitted sub strings
//
 ACHANDLE strsplit(char * srcStr, char * delim);

//Call back function to release string resource in dynamic array (see dynamic array)
//
//Parameter:
//	obj				Object reference
//Return:
//	None
//
 void OnAC_StringDestroy(void *obj);

#endif
